package com.danceforyou.receipt.service.impl;

import com.danceforyou.common.service.impl.BaseServiceImpl;
import com.danceforyou.receipt.dao.ReceiptVoucherDAO;
import com.danceforyou.receipt.model.ReceiptVoucherDO;
import com.danceforyou.receipt.service.ReceiptVoucherService;
import com.danceforyou.receipt.vo.ReceiptVoucherVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 类名称：ReceiptVoucherServiceImpl
* 创建人：danceforyou
* 创建时间：2021年02月07日
* 版本号：1.0v
*/
@Service("receiptVoucherService")
public class ReceiptVoucherServiceImpl extends BaseServiceImpl<Long, ReceiptVoucherDO, ReceiptVoucherVO, ReceiptVoucherDAO> implements ReceiptVoucherService {
    @Autowired
    private ReceiptVoucherDAO receiptVoucherDAO;

    @Override
    public ReceiptVoucherDAO getDao() {
        return receiptVoucherDAO;
    }

    @Override
    public void saveInfo(ReceiptVoucherDO receiptVoucher) {
        this.insert(receiptVoucher);
    }

    @Override
    public void updateInfo(ReceiptVoucherDO receiptVoucher) {
        this.update(receiptVoucher);
    }

    @Override
    public int deleteInfoByIds(String ids) {
        String[] idArr = ids.split(",");
        int i = 0;
        for (String id : idArr) {
            i += this.deleteById(id);
        }
        return i;
    }
}
